<extend name="Public/base"/>
<block name="style">
    <link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>
<block name="body">

    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="fa fa-globe"></i>学生信息</div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
                            <a class="btn green" href="{:U('addStudent')}">新 增</a>
                            <a class="btn green" href="javascript:;">删 除</a>
                            <a class="btn green" id="sheet" target="_blank" href="{:U('Database/excel_form?sheet='.C('SDT_INFO').'&excel_name=导入学生信息')}">导入</a>
                            <a class="btn green" href="{:U('ExcelOut/studentOut?cid='.$_GET['cid'])}">导出Execl</a>
                        </div>
                        <div class="btn-group pull-right">
                            <a class="btn green yellow-stripe"><i class="fa fa-tag"></i> {$_GET['grade_name']}</a>
                            <button class="btn btn-default">总人数：{$_total}人</button>
                            <button class="btn btn-default">男 生：{$man_count}人</button>
                            <button class="btn btn-default">女 生：{$_total - $man_count} 人</button>
                        </div>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                        <tr>
                            <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
                            <th>ID</th>
                            <th>姓名</th>
                            <th>学号</th>
                            <th>性别</th>
                            <th>班级</th>
                            <th>身份证号</th>
                            <th>更新时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="_list" id="sub">
                            <tr class="odd gradeX">
                                <td><input class="ids checkboxes" type="checkbox" name="" id="" value="{$sub['sid']}"> </td>
                                <td>{$sub.stid}</td>
                                <td>{$sub.username}</td>
                                <td>{$sub.student_number}</td>
                                <td><if condition="$sub.sex eq 1">
                                    女<else/>男
                                </if></td>
                                <td>{$sub.grade_name}</td>
                                <td>{$sub.idcard}</td>
                                <td>{$sub.update_time|date="Y-m-d",###}</td>
                                <td>
                                    <a href="{:U('User/stdDetail?stid='.$sub['stid'])}">详情</a>
                                    <a href="{:U('User/stdPerformance?stid='.$sub['stid'])}">成绩</a>
                                    <a>管理</a>
                                    <a title="编辑" href="{:U('addStudent?stid='.$sub['stid'])}">编辑</a>
                                    <a class="confirm ajax-get" title="删除" href="{:U('stdel?stid='.$sub['stid'])}">删除</a>
                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>

                    <div class="page">
                        {$_page}
                    </div>
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>

    <div class="modal" id="basic" style="display: none;background:rgba(0,0,0,0.5)!important;" >
        <div class="modal-dialog modal-wide">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close closes" data-dismiss="modal" aria-hidden="true"></button>
                    <h4 class="modal-title text-center">学生信息导入</h4>
                </div>
                <div class="modal-body">
                    请务必确认数据已填写到弹出的excel里面，数据填写或粘贴后请刷新页面重复确认无误后，再点击下方的【确定导入】按钮！
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn default closes" >关闭</button>
                    <a id="daoru" class="confirm ajax-get" href="{:U('ExcelOut/into_std_info?sheetid='.C(SDT_INFO).'&cid='.$cid.'&gid='.$gid)}"><button type="button" class="btn blue">确定导入</button></a>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
</block>

<block name="script">
    <script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
    <script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
    <script src="__STATIC__/scripts/app.js"></script>
    <script src="__STATIC__/scripts/table-managed.js"></script>
    <script>

        jQuery(document).ready(function() {
            App.init();
            TableManaged.init();
                highlight_subnav('{:U('User/classAndGrade')}');
        });
        $("#sheet").click(function(){
            $("#basic").show();
        })
        $("#daoru").click(function(){
            $("#basic").hide();
        });
        $(".closes").click(function(){
            $("#basic").hide();
        })
    </script>
</block>